A common type of geometric distortion in an imaging system including a zoom lens is barrel distortion. Barrel distortion manifests itself in that the magnification decreases with distance from the optical axis, and as such barrel distortion is categorized as a radial distortion. Another type of radial distortion is pincushion distortion and moustache distortion, and in many imaging systems a combination of these three geometric distortions may coexist although the effect of one or two may be negligible in relation to a third. For the purposes and application of the present invention barrel distortion would be the prominent one. The effect of barrel distortion may be that a rectangular object with four straight edges as imaged will obtain a barrel-like shape where the edges are convex, hence the name.
Depending on the zoom settings the geometric distortion may be more or less pronounced, and the general tendency is that the effects are reduced as the degree of zoom is increased, yet the distortion will also depend on other parameters, such as focus.
In some applications the effect of barrel distortion is acceptable or even wanted, yet in other applications post-processing of the affected images is used. Most image post-processing software includes a barrel distortion correction function in which a user may alter various parameters for reducing the effects of barrel distortion in images acquired.
When applying barrel distortion correction to a video stream the use of trial and error is less applicable, in particular if zoom optics are utilized. The solution is instead to map the imaging optics such that the correction function to be applied is known for each zoom setting of the optics (the lens, the set of lenses, etc.). The correction function may be a polynomial representing the level of distortion of an image as a function of radius (i.e. distance from the optical axis). The polynomial may be obtained by the approximation of the distortion curve, characteristic to the specific focal length of the optic lens. Having the information, how the optic's characteristic look like for different values of the focal lengths, it is possible to calculate the set of polynomial coefficients for each possible zoom position. This set of coefficients may be stored as constant values, and subsequently the calculations are applied when a zoom setting is changed. Consequently the image processing unit may be provided with updated data concerning the zoom settings. After a mapping of the imaging optics the only input needed for a correction to be performed is thus the current zoom settings for the imaging optics. In an imaging processing module of the camera the pixels are rearranged in accordance with the mapping previously performed, or according to a theoretical approach. In the above and below zoom has been used to define imaging optics having variable focal length settings, normally including varifocal lens systems and parfocal lens systems to mention two common types.